﻿<UserControl x:Class="StockAnalyst2.Plugins.Visualization.Historical.CustomDataViewer"
    		 x:ClassModifier="internal"
			 
			 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             mc:Ignorable="d" 
			 
             xmlns:Historical="clr-namespace:StockAnalyst2.Plugins.Visualization.Historical"
			 Background="#1F1F1F" 
			 
			 d:DataContext="{d:DesignInstance Type=Historical:CustomDataViewerVM}" 
			 d:DesignWidth="1000" 
			 Loaded="UserControl_Loaded">

	<UserControl.Resources>
		<ResourceDictionary>
			<ResourceDictionary.MergedDictionaries>
				<ResourceDictionary Source="..\..\..\StockAnalystTheme.xaml" />
			</ResourceDictionary.MergedDictionaries>
		</ResourceDictionary>
	</UserControl.Resources>

	<Expander IsExpanded="False">
		<Expander.HeaderTemplate>
			<DataTemplate>
				<TextBlock Foreground="{StaticResource FontBrush}" Text="Custom Plugin Data" FontWeight="Bold" Margin="9,3,3,3" />
			</DataTemplate>
		</Expander.HeaderTemplate>
		<DockPanel>
            <ListBox ItemsSource="{Binding Data}" ScrollViewer.CanContentScroll="False" HorizontalContentAlignment="Stretch" ScrollViewer.HorizontalScrollBarVisibility="Disabled" Margin="5" Background="#1F1F1F" SelectionMode="Single" SelectedItem="{Binding SelectedItem}" >
				<ListBox.ItemContainerStyle>
					<Style TargetType="ListBoxItem">
						<Style.Resources>
							<!-- Background of selected item when focussed -->
							<LinearGradientBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" StartPoint="0,0" EndPoint="1,0" >
								<GradientStop Color="#454545" Offset="0" />
								<GradientStop Color="#1F1F1F" Offset="0.01" />
								<GradientStop Color="#1F1F1F" Offset="0.99" />
								<GradientStop Color="#454545" Offset="1" />
							</LinearGradientBrush>
							<!-- Background of selected item when not focussed -->
							<LinearGradientBrush x:Key="{x:Static SystemColors.ControlBrushKey}" StartPoint="0,0" EndPoint="1,0" >
								<GradientStop Color="#454545" Offset="0" />
								<GradientStop Color="#1F1F1F" Offset="0.01" />
								<GradientStop Color="#1F1F1F" Offset="0.99" />
								<GradientStop Color="#454545" Offset="1" />
							</LinearGradientBrush>
						</Style.Resources>
					</Style>
				</ListBox.ItemContainerStyle>
				<ListBox.ContextMenu>
                    <ContextMenu>
						<MenuItem Header="Copy" Command="{Binding CopyCommand}" >
							<MenuItem.Icon>
								<Image Source="..\..\..\Resources\Copy.ico" />
							</MenuItem.Icon>
						</MenuItem>
						<MenuItem Header="Export To File ..." Command="{Binding ExportToFileCommand}" >
							<MenuItem.Icon>
								<Image Source="..\..\..\Resources\Export.ico" />
							</MenuItem.Icon>							
						</MenuItem>
					</ContextMenu>
                </ListBox.ContextMenu>
            </ListBox>
		</DockPanel>
	</Expander>
</UserControl>
